package com.heima.media.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.heima.common.dto.PageResponseResult;
import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.WmSensitiveDto;
import com.heima.media.entity.WmSensitive;
import com.xiaoleilu.hutool.date.DateTime;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.media.service.IWmSensitiveService;

import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * <p>
 * 敏感词信息表 前端控制器
 * </p>
 *
 * @author syl
 * @since 2023-04-21
 */
@RestController
@RequestMapping("/api/v1/sensitive")
@Api(tags = "敏感词信息表接口")
@CrossOrigin
public class WmSensitiveController{

    @Autowired
    private IWmSensitiveService wmSensitiveService;

    @PostMapping("/list")
    public PageResponseResult listBySensitive(@RequestBody WmSensitiveDto wmSensitiveDto){

        return wmSensitiveService.findList(wmSensitiveDto);
    }
    @PostMapping
    public ResponseResult saveSensitive(@RequestBody WmSensitive wmSensitive){

        return wmSensitiveService.saveSensitive(wmSensitive);
    }
    @DeleteMapping("{id}")
    public ResponseResult delSensitive(@PathVariable Integer id){
        return wmSensitiveService.delSensitive(id);
    }
    @PutMapping
    public ResponseResult updateSensitive(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.updateSensitive(wmSensitive);
    }
}
